#include <bits/stdc++.h>
using namespace std;
class Image
{
public:
    Image(){

    }
    virtual void display() = 0;

};
class RealImage : public Image{


 public:
    RealImage(string fileName){
      this->fileName = fileName;
      loadFromDisk(fileName);
   }

    void display() {
       cout<<("Displaying " + fileName)<<endl;;
   }

    void loadFromDisk(string fileName){
      cout<<("Loading " + fileName)<<endl;;
   }
private:
    string fileName;
};

class ProxyImage : public Image{



public:
   ProxyImage(string fileName){
      this->fileName = fileName;
      p_realImage = nullptr;
   }

    void display() {
      if(p_realImage == nullptr){
         p_realImage = new RealImage(fileName);
      }
      p_realImage->display();
   }
private:
    RealImage *p_realImage;
    string fileName;
};

int main(void)
{

    Image * image = new ProxyImage("test_10mb.jpg");
     image->display();
    return 0;
}
